<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-transform">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    <title>百乐汇-客服</title>
    <link href="assets/img/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link href="assets/css/xiaoji-style.css" rel="stylesheet" type="text/css">
    <link href="assets/css/jquery-ui.min.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="assets/js/jquery.SuperSlide.2.1.js"></script>
    <script type="text/javascript" src="assets/js/jquery.nicescroll.js"></script>
    <script type="text/javascript" src="assets/js/jquery-ui.js"></script>
    <script type="text/javascript" src="assets/js/moment.min.js"></script>
    <script type="text/javascript" src="assets/js/art-template.js"></script>
    <script type="text/javascript" src="assets/js/utils.js"></script>
    <script type="text/javascript" src="assets/js/querystring.js"></script>
</head>
<body class="xiaoji_machine">
<!-- header -->
<div class="header">
    <div class="logo"></div>
</div>
<!-- header -->
<!-- content-->
<div class="contents" style="height: 294px;">
    <div class="col60 main-left" style=" position:relative; z-index:1;">
        <div class="conter1" id="style_2" tabindex="5000" style="height: 159px; overflow-y: hidden; outline: none;">
            
        </div>
        <div class="conter2" style=" position:relative; z-index:10;">
            <div class="hfk">
                <textarea id="MSG" placeholder="简单输入，精准信息即刻展现~~" name="" cols="" rows=""
                          class="input_styel1 ui-autocomplete-input" autocomplete="off"></textarea>
            </div>
            <div class="tx">
                还可以输入<span id="tx-numbers">100</span>字
            </div>
            <div style="float: right; margin-right: 12px;">
                <input name="" type="button" value="发送 Enter" class="send_button" onclick="exec()">
            </div>
        </div>
    </div>
    <!--右侧内容-->
    <div class="col40 main-right" style="height: 294px;">
        <div class="zj" tabindex="5001" style="overflow-y: hidden; outline: none;">
            <h2>
                <img src="assets/img/fs_nav.png" alt="">服务方式
            </h2>
            <div class="text">智能的、即时的、互动式的自动服务。</div>
            <h2>
                <img src="assets/img/nr_nav.png" alt="">服务内容
            </h2>
            <div class="text">在线问题咨询，线下充值咨询</div>
            <h2>
                <img src="assets/img/sj_nav.png" alt="">服务时间
            </h2>
            <div class="text">7X24小时全天候为您服务。</div>
            <h2>
                <img src="assets/img/lj_nav.png" alt="">了解更多
            </h2>
            <div class="text" style="border: none;">
                请您输入您要咨询的问题，系统会针对您提交的问题进行语义分析。<br> 使用简短，关键性词句。<br>
                多维度提供咨询结果。<br>建议使用IE8以上版本浏览器或者Chrome谷歌、Firefox火狐等主流浏览器。
            </div>
        </div>
        <div class="zj01" tabindex="5002" style="overflow-y: hidden; outline: none; left: 100%;">
        <div class="coner3" id="coner3-url" style="width: 100%; background: rgba(255, 255, 255, 0); height: auto; position: fixed; bottom: 30px;">
        <input id="redirect-url" type="button" onclick="openNewWindow()" style="margin-left: 37%; display: none;" class="send_button" value="查看详情">
        </div>
        <div class="fh">
        <a href="http://faqrobot.jl.gov.cn/ckm-qa/web#">
        <img id="rightarrow" src="assets/img/jt_nav.png" onmouseover="changearrow()" onmouseleave="recoverarrow()" alt="">
        </a>
        </div>
        <div id="right_title" class="right-title"></div>
        <div class="zly_xj_20170241" id="rightHd"></div>
        </div>
    </div>
</div>
<!-- /content-->

<!--提问模板-->
<script id="xiaojihuida-zn-wen" type="text/html">
    <div class="zn_wen">
        <div class="tip"></div>
        <div class="pic"><img id="left_icon" src="assets/img/sqd_tx1.jpg" alt=""/></div>
        <div class="text">
            <span class="you-want-to-know">我:</span>
            {{keyword}}
        </div>
    </div>
</script>
<!--不知道答案模板-->
<script id="xiaojihuidaTchd" type="text/html">
    <div class="zn_da">
        <div class="pic"><img id="service_icon" src="assets/img/sqd_tx.png" alt=""/>
        </div>
        <div class="text">
            <div class="ans">
                <span class="answer"></span>
            </div>
            <!-- div style="width:110px; float:right;">
                <a onClick="score('{{id}}',1)" style="cursor:pointer;">
                    <img src="assets/img/ico1.png"
                         style="float:left;" alt="顶一下"/>
                    <span style="float:left;">顶</span>
                </a>&nbsp;&nbsp;&nbsp;&nbsp;
                <a onClick="score('{{id}}',0)" style="cursor:pointer;">
                    <img src="assets/img/ico2.png"
                         style="float:left;" alt="踩一下"/>
                    <span style="float:left;">踩</span>
                </a>
            </div -->
        </div>
    </div>
</script>
<!--帮忙找到的内容模板-->
<script id="xiaojihuidaTcLb" type="text/html">
    <div class="zn_da">
        <div class="pic"><img src="assets/img/sqd_tx.png" alt=""/></div>
        <div class="text">
            <div class="zly_xj_20170224">您好，帮您找到了一些相关内容，是您想要的么？如果不是，您可以重新提问。</div>
            <br><br>

            <div class="category" categoryname="{{defaultcategoryname}}">
                <ul class="category-list" id="category-list">
                </ul>
            </div>
            <div class="bd">
                <div class="lxwd_conter1">
                    <div class="ul-list" id="ul-list"></div>
                    <div class="bottom" currentPageNumber=1 currentBatchNumber=1>
                        <input type="button" onClick="nextPage(this)" class="zly_xj_btn" value="换一页">
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>
<!--默认回答-->
<script id="defaultAnswer" type="text/html">
<div class="zn_da">
<div class="tip"></div>
<div class="pic"><img src="assets/img/sqd_tx.png" alt="">
</div>
<div class="text">
<div class="ans">
<span class="answer">
                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
                 <tbody>
                 <tr>
                     <td class="fontlan" height="44"><img
                             src="assets/img/meng_jiantou2.png"> <a
                             title="省发展和改革委员会"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=2c9090b15606c52e01560778158c0003&amp;page=1"
                             target="_blank"> 省发展和...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省教育厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=2c9090b1560af94b01560afad84d0002&amp;page=1"
                             target="_blank">
                         省教育厅</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省科技厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=2c9090b15606c52e0156077919430004&amp;page=1"
                             target="_blank">
                         省科技厅</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省工业和信息化厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a01569790f2670014&amp;page=1"
                             target="_blank">
                         省工业和...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省公安厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a01569793dfb80023&amp;page=1"
                             target="_blank">
                         省公安厅</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省国家安全厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156979498ee0026&amp;page=1"
                             target="_blank">
                         省国家安...</a></td>
                 </tr>
                 <tr>
                     <td class="fontlan" height="44"><img
                             src="assets/img/meng_jiantou2.png"> <a
                             title="省民政厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a01569794eba90028&amp;page=1"
                             target="_blank"> 省民政厅</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省司法厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156979544de002a&amp;page=1"
                             target="_blank">
                         省司法厅</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省财政厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976c058a0004&amp;page=1"
                             target="_blank">
                         省财政厅</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省人力资源和社会保障厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976a8bb10002&amp;page=1"
                             target="_blank">
                         省人力资...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省国土资源厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976735040000&amp;page=1"
                             target="_blank">
                         省国土资...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省环境保护厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976c98c40005&amp;page=1"
                             target="_blank">
                         省环境保...</a></td>
                 </tr>
                 <tr>
                     <td class="fontlan" height="44"><img
                             src="assets/img/meng_jiantou2.png"> <a
                             title="省住房和城乡建设厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976ce1c30006&amp;page=1"
                             target="_blank
                         "> 省住房和...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省交通运输厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976d1e100007&amp;page=1"
                             target="_blank">
                         省交通运...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省水利厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976d56d90008&amp;page=1"
                             target="_blank">
                         省水利厅</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省农业委员会"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976d98c60009&amp;page=1"
                             target="_blank">
                         省农业委...</a></td>
                     <td class="fontlan">
                         <img src="assets/img/meng_jiantou2.png">
                         <a title="省商务厅"
                            href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976dc5e8000a&amp;page=1"
                            target="_blank"> 省商务厅</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省文化厅"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976e1964000b&amp;page=1"
                             target="_blank">
                         省文化厅</a></td>
                 </tr>
                 <tr>
                     <td class="fontlan" height="44"><img
                             src="assets/img/meng_jiantou2.png"> <a
                             title="省卫生和计划生育委员会"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976e62bb000c&amp;page=1"
                             target="_blank"> 省卫生和...</a></td>

                     <td class="fontlan">
                         <img src="assets/img/meng_jiantou2.png">
                         <a title="省林业厅"
                            href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976eaf84000d&amp;page=1"
                            target="_blank"> 省林业厅</a>
                     </td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省政府外事办公室"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976ef9bd000e&amp;page=1"
                             target="_blank">
                         省政府外...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省工商行政管理局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976f3083000f&amp;page=1"
                             target="_blank">
                         省工商行...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省安全生产监督管理局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976f68590010&amp;page=1"
                             target="_blank">
                         省安全生...</a></td>
                     <td class="fontlan">
                         <img src="assets/img/meng_jiantou2.png"> <a title="省质量技术监督局"
                                                                                                href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976f9faf0011&amp;page=1"
                                                                                                target="_blank">
                         省质量技...</a></td>
                 </tr>
                 <tr>
                     <td class="fontlan" height="44"><img
                             src="assets/img/meng_jiantou2.png"> <a
                             title="省新闻出版广电局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156976fd73d0012&amp;page=1"
                             target="_blank"> 省新闻出...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省食品药品监督管理局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56976735015697701b870013&amp;page=1"
                             target="_blank">
                         省食品药...</a></td>
                     <td class="fontlan">
                         <img src="assets/img/meng_jiantou2.png">
                         <a title="省统计局" href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb569767350156977049bc0014&amp;page=1" target="_blank">
                         省统计局</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png">
                         <a title="省旅游局" href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56976735015697707cda0015&amp;page=1" target="_blank">
                         省旅游局</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省体育局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156978c2ad00000&amp;page=1"
                             target="_blank">
                         省体育局</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省粮食局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156978caa420002&amp;page=1"
                             target="_blank">
                         省粮食局</a></td>
                 </tr>
                 <tr>
                     <td class="fontlan" height="44"><img
                             src="assets/img/meng_jiantou2.png"> <a
                             title="省经济技术合作局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156978d0c960004&amp;page=1"
                             target="_blank"> 省经济技...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省人民防空办公室"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156978d59140005&amp;page=1"
                             target="_blank">
                         省人民防...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省金融工作办公室"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156978e2f730006&amp;page=1"
                             target="_blank">
                         省金融工...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省能源局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156978e65840007&amp;page=1"
                             target="_blank">
                         省能源局</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省物价局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156978e99fc0008&amp;page=1"
                             target="_blank">
                         省物价局</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省公务员局"
                             href="http://www.jlzwfw.gov.&#10;cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156978ed3870009&amp;page=1"
                             target="_blank">
                         省公务员...</a></td>
                 </tr>
                 <tr>
                     <td class="fontlan" height="44"><img
                             src="assets/img/meng_jiantou2.png"> <a
                             title="省畜牧业管理局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156978f1286000a&amp;page=1"
                             target="_blank"> 省畜牧业...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省中医药管理局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156978f4d30000b&amp;page=1"
                             target="_blank">
                         省中医药...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省测绘地理信息局"
                             href="http://www.jlzwfw.g&#10;ov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a01569791444b0016&amp;page=1"
                             target="_blank">
                         省测绘地...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省气象局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a01569791a03c0018&amp;page=1"
                             target="_blank">
                         省气象局</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省地震局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a0156979213b7001a&amp;page=1"
                             target="_blank">
                         省地震局</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省邮政管理局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb5&#10;6978c2a015697928a1c001c&amp;page=1"
                             target="_blank">
                         省邮政管...</a></td>
                 </tr>
                 <tr>
                     <td class="fontlan" height="44"><img
                             src="assets/img/meng_jiantou2.png"> <a
                             title="省国家知识产权局长春代办处"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a01569792dbc0001e&amp;page=1"
                             target="_blank"> 省国家知...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省民政厅婚姻登记处"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=402881eb56978c2a01569793404e0020&amp;page=1"
                             target="_blank">
                         省民政厅...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省直住房公积金管理中心"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classi&#10;fyid=402881eb56978c2a0156979398200022&amp;page=1"
                             target="_blank">
                         省直住房...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省直机关事务管理局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=8a81a0f357a8b22d0157a8b22d320000&amp;page=1"
                             target="_blank">
                         省直机关...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省地方税务局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=8a81a0f357a8b22d0157a8b312140002&amp;page=1"
                             target="_blank">
                         省地方税...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省残疾人联合会"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=8a81a0f357a8b22d0157a8b4dfbf0004&amp;page=1"
                             targe="" t="_blank">
                         省残疾人...</a></td>
                 </tr>
                 <tr>
                     <td class="fontlan" height="44"><img
                             src="assets/img/meng_jiantou2.png"> <a
                             title="省人民政府法制办公室"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=8a81a0f357a8b22d0157a8b571ed0006&amp;page=1"
                             target="_blank"> 省人民政...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省供销合作社"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=8a81a0f357a8b22d0157a8b5fd160008&amp;page=1"
                             target="_blank">
                         省供销合...</a></td>
                     <td class="fontlan"><img src="assets/img/meng_jiantou2.png"> <a
                             title="省通信管理局"
                             href="http://www.jlzwfw.gov.cn:80/jl/index/showDirectoryAction.action?classifyid=8a81a7d35949291b015949291bd00000&amp;page=1"
                             ta="" rget="_blank">
                         省通信管...</a></td>
                 </tr>
                 </tbody>
                 </table>
            </span>
</div>
<div style="width:110px; float:right;">
    <a onclick="" style="cursor:pointer;">
        <img src="assets/img/ico1.png" style="float:left;" alt="顶一下">
        <span style="float:left;">顶</span>
    </a>&nbsp;&nbsp;&nbsp;&nbsp;
    <a onclick="" style="cursor:pointer;">
        <img src="assets/img/ico2.png" style="float:left;" alt="踩一下">
        <span style="float:left;">踩</span>
    </a>
</div>
</div>
</div>
</script>
<script type="application/javascript" src="assets/js/robotSocket.js"></script>
<script type="text/javascript">
// 获取当前URL下的access_token
window.queryString = new QueryStringParser();
if (!window.WebSocket){
    alert("WebSocket not supported by this browser!");
}

var urlRoot = queryString.getParam("up");
var defaultServiceLogo = "assets/img/sqd_tx.png";
var defaultUserLogo = "assets/img/sqd_tx1.jpg";

var ak = queryString.getParam("ak");
var uid = Number.parseInt(queryString.getParam("uid"));
var client_type = queryString.getParam("ct");
console.log(ak);
console.log(uid);
console.log(client_type);

if(!ak || !uid){
    alert("非法的用户信息，请使用正确的方式登录并使用。");
}

var regInfo = {
    event_type: 'reg',
    client_type : client_type,
    user_id: uid,
    access_token:ak
};
var regMethod = function(event){
    robotSocket.sendMsg(regInfo);
    var sstr = "用户";
    if(client_type == "SERVICE"){
        sstr = "客服";
    }
    console.log(sstr + "注册成功");
}
robotSocket.setRegMethod(regMethod);

//开始连接服务端
robotSocket.connectWS();

var htmlD='您好，您的问题我现在还没办法回答，不过请给我一些学习的时间，之后我会提供更好的服务。';
var dataInit={id:1,ans:htmlD};
$.ajaxSetup({
    cache: false
});
$(document).ready(function () {
    $("#redirect-url").hide();
    //定位到问题输入框
    $("#MSG").focus();
    // 防止自动提交
    $("#MSG").keypress(function (e) {
        if ((e.which || e.keyCode) == 13) {
            return false;
        }
    });
    // 上翻下翻
    $("#MSG").keyup(function (e) {
        if ((e.which || e.keyCode) == 13) {
            exec();
        } else if ((e.which || e.keyCode) == 38) {
            $('input:text').val(info.up());
        } else if ((e.which || e.keyCode) == 40) {
            $('input:text').val(info.down());
        }
    });

    $(function () {
        $(".conter1").niceScroll({
            cursorcolor: "#666666",
            cursoropacitymax: 1,
            touchbehavior: false,
            cursorwidth: "5px",
            cursorborder: "0",
            cursorborderradius: "5px",
            horizrailenabled: false
        });
        $(".zj").niceScroll({
            cursorcolor: "#666666",
            cursoropacitymax: 1,
            touchbehavior: false,
            cursorwidth: "5px",
            cursorborder: "0",
            cursorborderradius: "5px",
            horizrailenabled: false
        });
        $(".zj01").niceScroll({
            cursorcolor: "#666666",
            cursoropacitymax: 1,
            touchbehavior: false,
            cursorwidth: "5px",
            cursorborder: "0",
            cursorborderradius: "5px",
            horizrailenabled: false
        });
    });
    var cache = {};
    $("#MSG").autocomplete({
        source: function (request, response) {
            var term = request.term;
            if (term in cache) {
                response(cache[term]);
                return;
            }

            var inputLength = $("#MSG").val().trim().length;
            var surplusLength = 100 - inputLength;
            if (surplusLength > 0) {
                $("#tx-numbers").html(surplusLength);
            } else {
                $("#tx-numbers").html("0");
            }


//            var str = filterSpecialStr(term).trim();
//            if (str != "") {
//                $.post('/ckm-qa/web/autocomplete;jsessionid=F82BA626212B7EB7F4314B8EBB99B9D1',
//                        {term: term},
//                        function (data, textStatus, jqXHR2) {
//                            cache[term] = data;
//                            response(data);
//                            $("MSG").blur();
//                        },
//                        'json');
//            }
        },
        minLength: 2,
        position: { my: "left bottom", at: "left top" }

    });
    $(".fh").click(function () {
        $(".zj01").animate({left: "100%"}, function () {
            $("#redirect-url").hide();
            $(".zj").show();
        });
    });
    $.ajax({
           type: "POST",
           url: urlRoot + "api/get_message_history",
           headers:{
               session_id:ak
            },
           data: {page_index: 1, page_size: 10},
           dataType: "application/json",
           success: function (data) {
               var data_list = data.data.data_list;
               //alert(JSON.stringify(data));
               for (var i = 0; i < data_list.length; i++) {
                   var item = data_list[i];
                   var msg = {};
                   msg.message = item.message;
                   if (item.send_from == "USER") {
                       msg.sender_logo = defaultUserLogo;
                       if (item.user_logo && item.user_logo.length > 0) {
                           msg.sender_logo = item.user_logo;
                       }
                       msg.sender_id = item.user_uid;
                       msg.sender_name = item.user_name;
                       msg.time = item.time;
                   } else {
                       msg.sender_logo = defaultServiceLogo;
                       if (item.service_logo && item.service_logo.length > 0) {
                           msg.sender_logo = item.service_logo;
                       }
                       msg.sender_id = item.service_uid;
                       msg.sender_name = item.service_name;
                       msg.time = item.time;
                   }
                   if (client_type == item.send_from) {//如果与当前用户类型相同，放左边
                       fillRightItem(msg);
                   }
                   //不是相同类型放右边
                   else {
                       fillLeftItem(msg);
                   }
               }
               //$("#style_2")
           }
       });
});
function fillLeftItem(msg){
    var ans = msg.message;
    var html = template("xiaojihuidaTchd", {id: msg.id});
    $("#style_2").append(html);
    $("#service_icon","#style_2").attr("src",msg.sender_logo);
    var scrollArea = $("#style_2").children(".zn_da:last-child");
    var ansArea = $("#style_2").children(".zn_da:last-child").children(".text").children(".ans").children(".answer");
    $(ansArea).append(ans);
    $("#style_2").animate({ scrollTop: $("#style_2").scrollTop() + $(scrollArea).offset().top - $("#style_2").offset().top}, 300);
}
function fillRightItem(msg){
     var youWantToknow = template("xiaojihuida-zn-wen", {keyword: msg.message});
     $("#style_2").append(youWantToknow);
    $("#left_icon","#style_2").attr("src",msg.sender_logo);
    var scrollArea = $("#style_2").children(".zn_wen:last-child");
    $("#style_2").animate({ scrollTop: $("#style_2").scrollTop() + $(scrollArea).offset().top - $("#style_2").offset().top}, 300);
    
}
var dataListObject;
var questionKeyword;
//问题提问
function exec() {
    questionKeyword = $("#MSG").val();
    var wordLength = questionKeyword.trim().length;
    if (wordLength > 100) {
        alert("问题字数:" + wordLength + ",您的问题字数有点多哦！");
        return;
    }
    category = "";
    $("#tx-numbers").html(100);

    if (questionKeyword == '' || questionKeyword == null || questionKeyword.trim().length == 0) {
        alert("对不起，请您输入想要提问的文字 ！");
        return;
    }
    questionKeyword = escapeHTML(questionKeyword);
    var str = filterSpecialStr(questionKeyword);
    if (str.substr(0, 1) == "[") {
        alert("您的问题中包含我识别不了的特殊字符" + str + "哦！");
        return;
    }
    fillQuestionsArea();
    $("#MSG").val("");
//    $("#MSG").blur();
//    if (questionKeyword == "预约预审") {
//        //预设的问题，返回预设列表
//        askPredict(questionKeyword);
//    } else {
//        //向ckm发送请求
//        askResultToCKM(questionKeyword, false);
//    }
   askResultToCKM(questionKeyword, false);
    $("#MSG").focus();
}
//将问题添加到聊天窗口
function fillQuestionsArea() {
    var youWantToknow = template("xiaojihuida-zn-wen", {keyword: questionKeyword});
    $("#style_2").append(youWantToknow);
    var scrollArea = $("#style_2").children(".zn_wen:last-child");
    $("#style_2").animate({ scrollTop: $("#style_2").scrollTop() + $(scrollArea).offset().top - $("#style_2").offset().top}, 300);
}

//注册事件处理器到roboSocket对象上
robotSocket.addListener(leftAnswerPageFill);
//返回问题的答案
var category = "";
function askResultToCKM(question, isSearch, obj) {
    $(".zj01").animate({left: "100%"}, function () {
        $("#redirect-url").hide();
        $(".zj").show();
    });
    //从全文检索数据库TRS Database Server中检索数据
//     $.post('',
//             {term: question, category: category},
//             function (data, textStatus, jqXHR2) {
//                 leftAnswerPageFill(data);
//             }
//             , 'json');
    var msg = {
                event_type: 'chat_client',   	    //操作事件类型
		        user_id: uid,             //发送者id
		        access_token: ak,             //发送者id
		        client_type: client_type, //用户类型
                message : questionKeyword,            //消息
                time: moment().format("YYYY-MM-DD hh:mm:ss")    //时间
       }
    robotSocket.sendMsg(msg);
    //leftAnswerPageFill(dataInit);
}
//返回预设回答。
function askPredict(question) {
//        $.post('', { question: question }, function (data, textStatus, jqXHR2) {
//            if (textStatus != 'success' || data == null) {
//                return;
//            }
//            $("#MSG").val('');
//            leftAnswerPageFill(data);
//        }, 'json');
    leftAnswerPageFillDefault();
    return;
}
//答案添加到聊天窗口，并滚动滚动条
function leftAnswerPageFill(dataStr) {
    var data = JSON.parse(dataStr);
    var ans = data.message;
    var html = template("xiaojihuidaTchd", {id: data.id});
    if(data.sender_logo){
        $(html,"#service_icon").attr("src",data.sender_logo);
    }
    if(data.sender_name){
        $(html,"#pic").append("<div>"+data.sender_name+"</div>");
    }
    $("#style_2").append(html);
    var scrollArea = $("#style_2").children(".zn_da:last-child");
    var ansArea = $("#style_2").children(".zn_da:last-child").children(".text").children(".ans").children(".answer");
    $(ansArea).append(ans);
    $("#style_2").animate({ scrollTop: $("#style_2").scrollTop() + $(scrollArea).offset().top - $("#style_2").offset().top}, 300);
}
//默认答案添加到聊天窗口，并滚动滚动条
function leftAnswerPageFillDefault() {
//        var ans = data.ans;
    var html = template("defaultAnswer");
    $("#style_2").append(html);
    var scrollArea = $("#style_2").children(".zn_da:last-child");
    var ansArea = $("#style_2").children(".zn_da:last-child").children(".text").children(".ans").children(".answer");
//        $(ansArea).append(ans);
    $("#style_2").animate({ scrollTop: $("#style_2").scrollTop() + $(scrollArea).offset().top - $("#style_2").offset().top}, 300);
}
//去除特殊字符
function filterSpecialStr(str) {
    var pattern = new RegExp("[`~!@#$^&*()=|{}':;',%\\[\\].<>/?~@#￥……&*（）——|{}【】‘”“'、]");
    var rs = "";
    var specialChar = "";
    for (var i = 0; i < str.length; i++) {
        rs = rs + str.substr(i, 1).replace(pattern, '');
    }
    specialChar = str.match(pattern);
    if (specialChar != null) {
        return "[" + specialChar + "]";
    }
    /*     if(str.length != rs.length){
     return "";
     } */
    return rs;
}
function send2() {
    $("#MSG").val("预约预审");
    exec();
}
//防注入
function escapeHTML(val) {
    val = val.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
    return val;
}
//    设置输入框位置
var smy_hei01 = $(window).height() - 100;
$(".contents").height(smy_hei01);
$(".col40").height(smy_hei01);
$("#style_2").height(smy_hei01 - 135);
//    浏览器大小重置
$(window).resize(function () {
    var smy_hei = $(window).height() - 100;
    $(".contents").height(smy_hei);
    $(".col40").height(smy_hei);
    $(".conter1").height(smy_hei - 135);
});
</script>
</body>
</html>